<template>
  <el-row :gutter="15">
    <el-col :span="24">
      <div class="pull-right">
        <el-button type="primary" @click="print">打 印</el-button>
      </div>
    </el-col>
    <el-col :span="24">
      <el-table
        :data="tableData"
        stripe
        style="width: 100%"
        hegiht="600"
      >
        <el-table-column
          label="序号"
          type="index"
          width="55">
        </el-table-column>
        <el-table-column
          prop="regionName"
          label="盘点区域">
        </el-table-column>
        <el-table-column
          prop="cargoOwnerName"
          label="所属商家">
        </el-table-column>
        <el-table-column
          prop="productNo"
          label="产品编号">
        </el-table-column>
        <el-table-column
          prop="productName"
          label="所属产品">
        </el-table-column>
        <el-table-column
          prop="packageCode"
          label="包件编号">
        </el-table-column>
        <el-table-column
          prop="packageName"
          label="包件名称">
        </el-table-column>
        <el-table-column
          prop="realityNum"
          label="库存包件数量">
        </el-table-column>
        <el-table-column
          prop="inventoryRealityNum"
          label="实际包件数量">
        </el-table-column>
        <el-table-column
          prop="dutyMan"
          label="责任人">
        </el-table-column>
      </el-table>
    </el-col>
    <PrintModal ref="PrintModal" :tableData="tableData" :detail="detail"></PrintModal>
  </el-row>
</template>

<script>
import {unixTimestampFilter} from '@/filters'
import PrintModal from '@/views/oms/warehouse/inventory/PrintModal'
export default {
  name: 'Conduct',
  components: {
    PrintModal
  },
  props: {
    inventoryId: {
      type: String,
      required: true
    },
    detail: {
      type: Object,
      required: true
    }
  },
  created() {
    this.getTableData()
  },
  data() {
    return {
      tableData: []
    }
  },
  methods: {
    unixTimestampFilter,
    getTableData() {
      this.$ajax.get('/ms-warehouse-order/inventory/findInventoryItemList', {inventoryId: this.inventoryId}).then(response => {
        if (response.success) {
          this.tableData = response.data
        }
      })
    },
    print() {
      this.$refs.PrintModal.show()
    }
  }
}
</script>

<style scoped>

</style>
